package controller;

import pojo.Product;
import service.ProductService;
import service.impl.ProductServiceimpl;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author LiangHaiBo
 * @version 1.0
 * @date 2021.9.7 上午 9:18
 */
@WebServlet("/index")
public class indexServlet extends BaseServlet {

    public String index(HttpServletRequest request,HttpServletResponse response) {
        ProductService productService = new ProductServiceimpl();
        List<Product> nList = productService.GetnewProdect();
        List<Product> hList = productService.GethotProdect();
        //将两个放在request域中
        request.setAttribute("nList",nList);
        request.setAttribute("hList",hList);

        return "/jsp/index.jsp";

    }
}
